home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 32 / jots.zip / POSSLIST.BAS < prev    next >
BASIC Source File  |  1989-03-13  |  2KB  |  87 lines

  1. ' POSSLIST.BAS -- This module maintains the list of possible letters
  2. ' and lets the user change the status of letters in that list
  3. ' $INCLUDE: 'J.INC'
  4.  
  5. DIM SHARED MyBox AS BoxType, TopRow, BotRow, LftCol, RtCol
  6. DIM SHARED PossList AS STRING * 26
  7.  
  8. SUB InitPossList
  9.     CALL BoxCoords(PossListBox, MyBox)
  10.     TopRow = MyBox.TopRow
  11.     BotRow = MyBox.BotRow
  12.     LftCol = MyBox.LftCol
  13.     RtCol = MyBox.RtCol
  14.     PossList$ = " "
  15.  
  16.     NormalBox (PossListBox)
  17.     LOCATE TopRow + 1, LftCol + 2, 0
  18.     COLOR Normal, Background, Background
  19.     PRINT "Possible Letters:";
  20.     RedrawPossList
  21. END SUB
  22.  
  23. SUB RemoveFromPossList (NewWord$)
  24.     FOR Lp = 1 TO 5
  25.         Letter$ = MID$(NewWord$, Lp, 1)
  26.         Posn = ASC(Letter$) - ASC("A") + 1
  27.         MID$(PossList$, Posn, 1) = Letter$
  28.     NEXT Lp
  29.     RedrawPossList
  30. END SUB
  31.  
  32. SUB ChangePossList
  33.     ShowMessage ("Enter letter to change, <TAB> for notes, <Return> to end")
  34.     HighlightBox (PossListBox)
  35.     DO
  36.         COLOR Normal, Background, Background
  37.         LOCATE TopRow + 1, LftCol + 35, 1, 0, 7
  38.         PRINT "==> ";
  39.         DO
  40.             Char$ = INKEY$
  41.         LOOP UNTIL LEN(Char$)
  42.         IF Char$ = CHR$(9) OR Char$ = CHR$(13) THEN     'TAB & RETURN
  43.             LOCATE TopRow + 1, LftCol + 35, 0
  44.             PRINT "     ";
  45.             NormalBox (PossListBox)
  46.             IF Char$ = CHR$(9) THEN
  47.                 MakeNotes
  48.             END IF
  49.             EXIT SUB
  50.         ELSE
  51.             Char$ = UCASE$(Char$)
  52.             IF Char$ >= "A" AND Char$ <= "Z" THEN
  53.                 Posn = ASC(Char$) - ASC("A") + 1
  54.                 OldValue$ = MID$(PossList$, Posn, 1)
  55.                 IF OldValue$ = " " THEN
  56.                     MID$(PossList$, Posn, 1) = Char$
  57.                 ELSE
  58.                     MID$(PossList$, Posn, 1) = " "
  59.                 END IF
  60.                 RedrawPossList
  61.                 RedrawGuessList
  62.             END IF
  63.         END IF
  64.     LOOP
  65. END SUB
  66.  
  67. FUNCTION PossibleLetterList$
  68.     PossibleLetterList$ = PossList$
  69. END FUNCTION
  70.  
  71. SUB RedrawPossList
  72.     LOCATE TopRow + 3, LftCol + 2, 0
  73.     TempKnown$ = KnownList$
  74.     FOR Lp = 1 TO 26
  75.         Char$ = CHR$(Lp + ASC("A") - 1)
  76.         IF INSTR(TempKnown$, Char$) THEN
  77.             COLOR Known, Background, Background
  78.         ELSEIF MID$(PossList$, Lp, 1) = " " THEN
  79.             COLOR Normal, Background, Background
  80.         ELSE
  81.             COLOR Exclude, Background, Background
  82.         END IF
  83.         PRINT CHR$(Lp + ASC("A") - 1); " ";
  84.     NEXT Lp
  85. END SUB
  86.  
  87.